﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Windows8Accelerator.Core.Xaml.Helpers;

namespace Windows8Accelerator.Core.Xaml.Controls
{
    public class SuperGroupStyle : GroupStyle
    {
        public SuperGroupStyle()
        {
            HeaderTemplateSelector = new SuperDataTemplateSelector(
                (item, container) => 
                {
                    var owner = container.GetParentOf<ISuperGroupStyleSelectorOwner>();
                    if (owner != null)
                    {
                        return owner.GroupHeaderTemplate;
                    }
                    return null;
                });
        }


        private Thickness _ContainerMargin;

        public Thickness ContainerMargin
        {
            get { return _ContainerMargin; }
            set { _ContainerMargin = value; }
        }
        public static readonly DependencyProperty ContainerMarginProperty =
            DependencyProperty.Register("ContainerMargin", typeof(Thickness), typeof(SuperGroupStyle), new PropertyMetadata(new Thickness(30)));

        public ItemsPanelTemplate Panel { get; set; }
    }
}
